# -*- coding: utf-8 -*-
"""
Created on Fri Aug 09 13:42:10 2013

@author: Jeanhwea
"""

import poplib
# import base64
hostname = 'pop3.126.com'
user = 'pythonsll@126.com'
passwd = 'password'

#hostname = 'pop.gmail.com'
#user = 'jenahwea@gmail.com'
#passwd = '******'

p = poplib.POP3_SSL(hostname)
p.user(user)
p.pass_(passwd)
status = p.stat()
print status
response, listings, octet_count = p.list()
response, lines, octet_c = p.retr(1)
print '\n'.join(lines)
# base64.b64decode(msg[6])
# msgt = [base64.b64decode(s) for s in msg]
p.quit()